package com.boboPlanet.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.boboPlanet.user.entity.dto.ArticleMainDTO;
import com.boboPlanet.user.entity.dto.ArticleMainInfoDTO;
import com.boboPlanet.user.entity.po.ArtCollectPO;
import com.boboPlanet.user.entity.po.ArticleMainInfoPO;
import com.boboPlanet.user.entity.po.CommentInfoPO;
import com.boboPlanet.user.entity.vo.UserArtListVO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: TODO
 * @Author: mis_wu
 * @Date: 2023/2/22
 **/
@Mapper
public interface ArticleMapper extends BaseMapper<ArticleMainInfoPO> {

    List<ArticleMainInfoDTO> getLogoutArticleMainInfo(@Param("dto") ArticleMainDTO dto,@Param("loginFlag") boolean flag);

    Boolean publishComment(@Param("po") CommentInfoPO po);

    List<CommentInfoPO> getCommentList(@Param("artId") Long artId);

    List<UserArtListVO> getUserArtList(@Param("dto") ArticleMainDTO mainDTO,@Param("userId") Long userId);

    Boolean collectArt(@Param("po") ArtCollectPO po);

    Boolean cancelCollectArt(@Param("userId") Long userId,@Param("artId") Long artId);

    int judgeCurrentArtIsCollect(Long artId, Long userId);

    ArticleMainInfoPO queryArtMainById(@Param("artId") Long artId);

}
